Skip to content

Instantly share code, notes, and snippets.

View freddieventura's full-sized avatar

freddieventura

  • London
View GitHub Profile
@RyanScottLewis
RyanScottLewis / gist:911786
Created April 9, 2011 21:23
BCR2000/BCF2000 SysEx Messages
require 'midi-winmm'
class Numeric
def to_hex
"%02x" % self
end
end
class String
def to_hex
@mhawksey
mhawksey / gist:1442370
Last active February 25, 2024 12:01
Google Apps Script to read JSON and write to sheet
function getJSON(aUrl,sheetname) {
//var sheetname = "test";
//var aUrl = "http://pipes.yahoo.com/pipes/pipe.run?_id=286bbb1d8d30f65b54173b3b752fa4d9&_render=json";
var response = UrlFetchApp.fetch(aUrl); // get feed
var dataAll = JSON.parse(response.getContentText()); //
var data = dataAll.value.items;
for (i in data){
data[i].pubDate = new Date(data[i].pubDate);
data[i].start = data[i].pubDate;
}
@mgedmin
mgedmin / show-all-256-colors.py
Last active August 24, 2023 16:23
Script to show all 256 colors supported by xterms
#!/usr/bin/python
"""Print a swatch using all 256 colors of 256-color-capable terminals."""
__author__ = "Marius Gedminas <marius@gedmin.as>"
__url__ = "https://gist.github.com/mgedmin/2762225"
__version__ = '2.0'
def hrun(start, width, padding=0):
@TomByrne
TomByrne / MultiExporter.jsx
Last active June 14, 2024 09:48
An Illustrator script for exporting layers and/or artboards into separate files (PNG8 / PNG24 / EPS / PDF / SVG / JPG / FXG).See http://www.tbyrne.org/export-illustrator-layers-to-svg-files
// MultiExporter.jsx
// Version 0.1
// Version 0.2 Adds PNG and EPS exports
// Version 0.3 Adds support for exporting at different resolutions
// Version 0.4 Adds support for SVG, changed EPS behaviour to minimise output filesize
// Version 0.5 Fixed cropping issues
// Version 0.6 Added inner padding mode to prevent circular bounds clipping
//
// Copyright 2013 Tom Byrne
// Comments or suggestions to tom@tbyrne.org
@miguelmota
miguelmota / README.md
Last active May 25, 2024 13:23
Multiple accounts with Mutt E-Mail Client (gmail example)

How to set up multiple accounts with Mutt E-mail Client

Thanks to this article by Christoph Berg

Instructions

Directories and files

~/
@ctrl-freak
ctrl-freak / android-adb-pull-apk.md
Last active July 4, 2024 09:37
Retrieve APK from Non-Rooted Android Device through ADB

https://stackoverflow.com/a/18003462/348146

None of these suggestions worked for me, because Android was appending a sequence number to the package name to produce the final APK file name (this may vary with the version of Android OS). The following sequence of commands is what worked for me on a non-rooted device:

  1. Determine the package name of the app, e.g. com.example.someapp. Skip this step if you already know the package name.

    adb shell pm list packages

    Look through the list of package names and try to find a match between the app in question and the package name. This is usually easy, but note that the package name can be completely unrelated to the app name. If you can't recognize the app from the list of package names, try finding the app in Google Play using a browser. The URL for an app in Google Play contains the package name.

@Sporax
Sporax / netsh.md
Created February 13, 2019 18:03
Cheat sheet to set windows firewall using powershell or netsh

Netsh

enable/disable firewall

netsh advfirewall set [privateprofile|publicprofile|domainprofile|currentprofile] state [on|off]

set default firewall action

netsh advfirewall set [privateprofile|publicprofile|domainprofile|currentprofile] firewallpolicy [allowinbound|blockinbound|blockinboundalways|notconfigured],[allowoutbound|blockoutbound|notconfigured]

add rule

netsh advfirewall firewall add rule name="My Application" dir=in action=allow program="C:\MyApp\MyApp.exe" enable=yes remoteip=157.60.0.1,172.16.0.0/16,LocalSubnet profile=domain

This file has been truncated, but you can view the full file.
2391 ##linux Channel website: https://freenode.linux.community | Pastebin: https://paste.linux.community | Need an op? Join ##linux-ops | CoC? ##linux-offtopic, please.
1931 #python Don't paste, use https://paste.pound-python.org/ | http://bit.ly/psf-coc | Tutorial: http://bit.ly/MCAhYx | New programmer? http://bit.ly/23X7emF | Specify 2.x or 3.x in your question | Find your local User Group: http://goo.gl/S1Zsq | #python-fr #python.de #python-es #python.tw #python-br #python-nl #python-ir #python.it #python-ro #python-india #python-hu #python-dk #python-dev
1926 #freenode Welcome to #freenode | Feel free to message staff at any time. You can find us using /stats p (shows immediately-available staff) or /who freenode/staff/* (shows all staff) | See https://freenode.net/news/spambot-attack regarding spam | User mode +R blocks unregistered user PMs
1787 #python PSF Survey: https://bit.ly/psf-survey-2018 | Anything about Python is on-topic. Don't paste, use https://paste.pound-python.org/ | Be nice: https://j.mp
@Alexey-Tsarev
Alexey-Tsarev / zfs_install.sh
Last active March 2, 2021 14:00
ZFS 0.8 at Raspberry Pi
#!/usr/bin/env sh
set -e
set -x
CUR_PWD="$(pwd)"
cd "$(dirname $0)"
if [ ! -d zfs ]; then
# https://github.com/zfsonlinux/zfs/wiki/Building-ZFS