Skip to content

Instantly share code, notes, and snippets.

View zs1621's full-sized avatar
💭
I may be slow to respond.

zs1621

💭
I may be slow to respond.
View GitHub Profile
@didip
didip / request_handler_test.py
Created March 12, 2011 21:46
Testing Tornado RequestHandlers
import unittest, os, os.path, sys, urllib
import tornado.database
import tornado.options
from tornado.options import options
from tornado.testing import AsyncHTTPTestCase
# add application root to sys.path
APP_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.append(os.path.join(APP_ROOT, '..'))
@enjalot
enjalot / bar.js
Created December 2, 2011 23:51
[dd3] d3.js selection tutorial
//Simple d3.js barchart example to illustrate d3 selections
//other good related tutorials
//http://www.recursion.org/d3-for-mere-mortals/
//http://mbostock.github.com/d3/tutorial/bar-1.html
var w = 300
var h = 300
@zs1621
zs1621 / papa.py
Created November 26, 2012 09:03
python save picture(papa)
#!/usr/bin/env python
#-*-coding="utf-8"-*-
#import MySQLdb
import httplib
import urllib
import simplejson
import time
import os
def papa(url):
@kennyz
kennyz / kongwu_pi_tips.md
Last active December 25, 2021 12:41
kongwu pi tips

折腾Pi,解决疑难杂症最好还是去官网论坛

image http://www.raspberrypi.org/phpBB3/

支持Apple TimeMachine,实现Mac备份

在磁盘中创建备份目录 mkdir /media/usbdisk/mactimebak 推荐使用ext4分区(打开notime)

安装nettalk

@amitsaha
amitsaha / fifo.c
Last active May 8, 2022 01:52
strace of pipe() and popen() and kernel tracing of pipe()
# include <sys/types.h>
# include <sys/stat.h>
# include <stdlib.h>
# include <stdio.h>
int main(int argc, char **argv)
{
FILE *fp1, *fp2;
int i,read;
char buffer[8];
#!/usr/bin/python
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select

This demo builds on previous gists in this series to render an audio-modulated WebGL animation, and output a 48 FPS, 1080p, HD video utilizing:

  • HTML5's Web Audio API for analysing an audio file.
  • HTML5's Web Worker API for offloading communications between the web page and the server to separate thread.
  • Socket.io for sending messages (including image and audio files) between client and server.
  • Node.js for the server process for storing generated images and uploaded audio and creating the final video.
  • FFMpeg for the actual video creation.
  • Fluent-ffmpeg for making the configuration and execution of FFMpeg commands easy peasy.
  • @ffmpeg-installer/ffmpeg for installing the correct version of FFMpeg for the hardware this demo runs on.
  • mkdirp for creating the folder path for each client's data, including any missing nodes in the path.
@unixzii
unixzii / ForceEnablingXcodeLLM.md
Last active July 27, 2024 11:20
A guide to force enabling Xcode LLM feature on China-SKU Macs.

Introduction

Apple restricted the access to Xcode LLM (Predictive code completion) feature on China models of Mac. This guide provides a way to bypass that restriction. It's verified on macOS 15.0 Beta (24A5264n), but there is no guarentee that it will always work on later macOS versions.

Prerequisites

  • Xcode is installed and run at least once.
  • SIP debugging restrictions are disabled (via csrutil enable --without debug command in recovery mode).

Disclaimer