Skip to content

Instantly share code, notes, and snippets.

View designviacode's full-sized avatar
🎯
Focusing

Manpreet Singh designviacode

🎯
Focusing
View GitHub Profile
@liyasthomas
liyasthomas / GitHub stats count Scriptable widget script.md
Last active January 18, 2024 06:36
GitHub stats count Scriptable widget script

To use this script, simply replace the USERNAME, REPOSITORY, GITHUB_STARS_REPO and GITHUB_DOWNLOADS_REPO placeholders with the appropriate values for the GitHub repository you want to fetch the star and release download count for. Then, copy the complete script into a new Scriptable App script and run it. The star and release download count for the specified repository will be displayed in a Scriptable widget.

// Constants for widget configuration
const WIDGET_TITLE = "GitHub";
const USERNAME = "hoppscotch"
const REPOSITORY = "hoppscotch"
const GITHUB_STARS_REPO = "hoppscotch/hoppscotch";
const GITHUB_DOWNLOADS_REPO = "hoppscotch/releases";
const CACHED_DATA_HOURS = 0.5;
@sergmetelin
sergmetelin / hackathon_how_to.md
Last active July 21, 2020 04:03
Hackathon Getting Started guide

About EOSIO

The EOS.IO software introduces a new blockchain architecture designed to enable vertical and horizontal scaling of decentralized applications. This is achieved by creating an operating system-like construct upon which applications can be built. The software provides accounts, authentication, databases, asynchronous communication and the scheduling of applications across many CPU cores or clusters. The resulting technology is a blockchain architecture that may ultimately scale to millions of transactions per second, eliminates user fees, and allows for quick and easy deployment and maintenance of decentralized applications, in the context of a governed blockchain.

About this guide:

Full documentation can be found at https://developers.eos.io/

This means your portal is correctly setup for the hackathon.

@JimWestergren
JimWestergren / checkPawnedPasswords.php
Last active December 22, 2023 23:06
Simple method to check the Pwned Passwords API using PHP
<?php
/**
* Simple method to use the API from https://www.troyhunt.com/ive-just-launched-pwned-passwords-version-2/
* Written by Jim Westergren and released to public domain
* @return int count
*/
function checkPawnedPasswords(string $password) : int
{
$sha1 = strtoupper(sha1($password));
$data = file_get_contents('https://api.pwnedpasswords.com/range/'.substr($sha1, 0, 5));
export default class Api {
static headers() {
return {
Accept: "application/json",
"Content-Type": "application/json"
};
}
static get(route) {
return this.request(route, null, "GET");
import React, { Component, PropTypes } from "react";
class SocketProvider extends Component {
constructor(props, context) {
super(props, context);
this.socket = context.socket;
}
render() {
return (
@macloo
macloo / twitter_bio_compiler_for_list.py
Last active October 20, 2022 22:27
Scrape members from a Twitter list and then get their bios, locations, etc.
#!/usr/bin/env python
# encoding: utf-8
"""
python 2.x
Scrape members from a Twitter list and then get their bios, locations, etc.
Based on
https://github.com/lamthuyvo/social-media-data-scripts/blob/master/scripts/twitter_bio_info_compiler.py
and
https://github.com/kylemanna/social-utils/blob/master/twitter/list-follow.py
@twilson63
twilson63 / README.md
Last active May 1, 2024 03:49
Cordova React Notes

Cordova Apps with React

React and OnsenUI work great for cordova apps, there are a couple things to keep in mind when working with Cordova Apps.

Relative Paths not Absolute Paths

Since Cordova Apps load from the file system they do not work great with absolute urls, they use relative urls, which means

<script src="/bundle.js"></script> will not work as you might expect when using a web server. Since the root file system of

device is not where the files are located. You can resolve this using a relative url.

@amysimmons
amysimmons / js-tricky-bits.md
Last active August 13, 2024 05:00
Understanding closures, callbacks and promises in JavaScript

#Understanding closures, callbacks and promises

For a code newbie like myself, callbacks, closures and promises are scary JavaScript concepts.

10 months into my full-time dev career, and I would struggle to explain these words to a peer.

So I decided it was time to face my fears, and try to get my head around each concept.

Here are the notes from my initial reading. I'll continue to refine them as my understanding improves.

@mrzmyr
mrzmyr / index.js
Created November 22, 2015 16:56
React Native - Detect Double Tap
var Index = React.createClass({
getInitialState: function () {
return {
lastPress: 0
}
},
onPress: function () {
var delta = new Date().getTime() - this.state.lastPress;
@gnz00
gnz00 / React-NProgress
Created October 4, 2015 12:20
src_routes.js
import React from 'react';
import Router from 'react-routing/src/Router';
import { canUseDOM } from 'fbjs/lib/ExecutionEnvironment';
import http from './core/HttpClient';
import App from './components/App';
import IndexPage from './components/IndexPage';
import NotFoundPage from './components/NotFoundPage';
import ErrorPage from './components/ErrorPage';