Skip to content

Instantly share code, notes, and snippets.

View azlkiniue's full-sized avatar
:shipit:
Forever a work in progress

Ahmada Yusril azlkiniue

:shipit:
Forever a work in progress
View GitHub Profile
@dsernst
dsernst / heapsPermute.js
Last active May 15, 2018 22:53
A JavaScript implement of Heap's efficient Permutation Algorithm: https://en.wikipedia.org/wiki/Heap%27s_algorithm
var swap = function (array, pos1, pos2) {
var temp = array[pos1];
array[pos1] = array[pos2];
array[pos2] = temp;
};
var heapsPermute = function (array, output, n) {
n = n || array.length; // set n default to array.length
if (n === 1) {
output(array);
@rduplain
rduplain / responsive_d3_example.html
Created April 18, 2012 14:55 — forked from mattalcock/responsive_d3_example.html
Responsive d3.js D3 Javascript Histogram Example
<!DOCTYPE html>
<script src="http://mbostock.github.com/d3/d3.v2.js?2.8.1"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<style>
body {
font: 10px sans-serif;
}
rect {
@jchernandez
jchernandez / SimpleRequest.java
Last active August 3, 2020 20:41
Simple Post Request with basic auth, using android Volley library
StringRequest request = new StringRequest(Request.Method.POST, url, new Response.Listener<String>() {
@Override
public void onResponse(String s) {
///handle response from service
}, new ErrorResponse() {
@Override
public void onErrorResponse(VolleyError volleyError) {
//handle error response
}
}) {
With 2^0 = 1 bit signed integers, Unix time will overflow on: 00:00:01 UTC January 01, 1970
With 2^0 = 1 bit unsigned integers, Unix time will overflow on: 00:00:02 UTC January 01, 1970
With 2^1 = 2 bit signed integers, Unix time will overflow on: 00:00:02 UTC January 01, 1970
With 2^1 = 2 bit unsigned integers, Unix time will overflow on: 00:00:04 UTC January 01, 1970
With 2^2 = 4 bit signed integers, Unix time will overflow on: 00:00:08 UTC January 01, 1970
With 2^2 = 4 bit unsigned integers, Unix time will overflow on: 00:00:16 UTC January 01, 1970
With 2^3 = 8 bit signed integers, Unix time will overflow on: 00:02:08 UTC January 01, 1970
@allenday
allenday / gini-balance-bitcoin.sql
Created January 31, 2019 10:31
Calculate Gini coefficient for Bitcoin balances.
WITH double_entry_book AS (
-- debits
SELECT
array_to_string(inputs.addresses, ",") as address
, inputs.type
, -inputs.value as value
, block_timestamp
FROM `bigquery-public-data.crypto_bitcoin.inputs` as inputs
UNION ALL
@datio
datio / commands.sh
Last active September 22, 2021 09:16
Hide Svelte or Sapper usage from Wappalyzer et al.
// make sure you have changed your working directory to your project
cd app
// svelte
// see https://github.com/sveltejs/svelte/issues/2900#issuecomment-701644971
npm install svelte
sed -i 's/svelte-\$/_$/g' ./node_modules/svelte/compiler.js
// sapper
npm install sapper
@dantheman213
dantheman213 / youtube-dl_cheatsheet.md
Last active January 23, 2022 01:40
youtube-dl best way to download video or entire to high quality mp3

youtube-dl cheat sheet

Docs and Binary for youtube-dl are located here:

https://github.com/rg3/youtube-dl/

Install dependencies

apt-get install libav-tools ffmpeg # Linux (either one of either should do) brew install ffmpeg # OSX choco install ffmpeg # Windows

@alexwebgr
alexwebgr / world-topo.json
Created April 9, 2014 10:01
topoJson json file with country codes, capitals, longitude, longitude
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@py7hon
py7hon / README.md
Last active July 25, 2022 07:35
Simple Python script for make watermark like windows activate

Watermark

Dependences:

  • python-gobject

Usage:

chmod +x watermark ./watermark

Screenshots:

@rezkyfm
rezkyfm / github-followback-checker.py
Last active February 18, 2023 15:20
Check if user in github follow you back or not
'''
Check if user in github follow you back or not
'''
import requests
username = input("Enter your username: ")
def main(username):