Skip to content

Instantly share code, notes, and snippets.

View faried's full-sized avatar

Faried Nawaz faried

View GitHub Profile
@faried
faried / wordproblems.py
Created July 5, 2015 14:45
simple word problems in python
#!/usr/bin/env python
"""Simple word questions.
pip install python-slugify gTTS inflect
"""
from random import choice, randint, randrange
import os
import os.path
from time import sleep
#!/usr/bin/env python
import optparse
import subprocess
import sys
import tempfile
import zlib
def doit(opts, pkg):
@faried
faried / gargoyle.diff
Created September 20, 2015 12:18
gargoyle from git HEAD; Apple LLVM version 7.0.0 (clang-700.0.72); Mac OS 10.10.5
diff --git a/Jamrules b/Jamrules
index 12fc83f..36ee295 100644
--- a/Jamrules
+++ b/Jamrules
@@ -138,10 +138,10 @@ switch $(OS)
case MACOSX :
Echo "OS is MACOSX (cocoa)" ;
SUFDLL = .dylib ;
- MAINARCH = -arch i386 ;
+ MAINARCH = -arch x86_64 ;
;; save the buffer when we get input
(defun zenicb-save-buffer-frequently (&rest foo)
(when (buffer-file-name)
(save-excursion
(save-buffer))))
(zenicb-add-hook 'zenicb-message-hook 'zenicb-save-buffer-frequently)
@faried
faried / settings.java
Created January 19, 2016 17:11
android - go to the app's details under settings.
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, Uri.fromParts("package", getPackageName(), null));
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
@faried
faried / migrate.txt
Created February 4, 2016 17:53
migrating to a new twitter account
if you want to change your twitter screen_name, use https://twitter.com/settings/account
if you want to move to a new account but don't want to give up the old one:
old user = @old
new user = @new
it helps to have two independent browser windows open (two different browsers,
or one browser with a normal window and an incognito window).
@faried
faried / explode.el
Created February 11, 2016 08:09
this can get annoying.
;; i'm using it in
;; "GNU Emacs 25.1.50.1 (x86_64-apple-darwin13.4.0, NS appkit-1265.21 Version 10.9.5 (Build 13F1134)) of 2015-12-09"
;; explode.wav is at
;; https://web.archive.org/web/20051029193334/http://www.arcanewolf.com/wizard/sounds/explode.wav
;; ring-bell-function described at https://www.emacswiki.org/emacs/AlarmBell
(setq ring-bell-function
(lambda ()
02-25 10:54:48.567 15735-15735/com.failapp A/art: art/runtime/thread.cc:1344] Throwing new exception 'length=146; index=1542' with unexpected pending exception: java.lang.ArrayIndexOutOfBoundsException: length=146; index=1542
02-25 10:54:48.567 15735-15735/com.failapp A/art: art/runtime/thread.cc:1344] at void com.failapp.fragments.LoginFragment.onClickedSignIn(android.view.View) (LoginFragment.java:100)
02-25 10:54:48.567 15735-15735/com.failapp A/art: art/runtime/thread.cc:1344] at void com.failapp.fragments.LoginFragment$$ViewBinder$1.doClick(android.view.View) (LoginFragment$$ViewBinder.java:24)
02-25 10:54:48.567 15735-15735/com.failapp A/art: art/runtime/thread.cc:1344] at void butterknife.internal.DebouncingOnClickListener.onClick(android.view.View) (DebouncingOnClickListener.java:22)
02-25 10:54:48.567 15735-15735/com.failapp A/art: art/runtime/thread.cc:1344] at boolean android.view.View.performClick() (View.java:5204)
02-25 10:54:48.567 15735-15735/com.failapp A/art: art/runtime/thread.cc:13
@faried
faried / figlet.py
Last active June 30, 2016 21:27
python-rtmbot/plugins/figlet/figlet.py
from __future__ import unicode_literals
from json import loads
from optparse import OptionParser
from shlex import split
from pyfiglet import Figlet
crontable = []
outputs = []
{
"log":[
"REST",
"Shadow",
"CRUD",
"CRUD+",
"HTTP",
"HTTP+",
"Access",
"Changes",