Skip to content

Instantly share code, notes, and snippets.

View Trumeet's full-sized avatar
🏳️‍⚧️

Yuuta Liang Trumeet

🏳️‍⚧️
View GitHub Profile
@dchest
dchest / gist:800407
Created January 28, 2011 15:37
Microsoft's Symbolic Plan
Microsoft's Symbolic Plan
=========================
(Redmond, Microsoft HQ. One year before Windows Vista release. Meeting.)
Marketing VC:
Our latest marketing research suggests that UNIX has a
competitive advantage: _symbolic links_.
@tonious
tonious / hash.c
Last active February 17, 2023 02:25
A quick hashtable implementation in c.
/* Read this comment first: https://gist.github.com/tonious/1377667#gistcomment-2277101
* 2017-12-05
*
* -- T.
*/
#define _XOPEN_SOURCE 500 /* Enable certain library functions (strdup) on linux. See feature_test_macros(7) */
#include <stdlib.h>
#include <stdio.h>
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 16, 2024 19:37
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
private boolean isServiceRunning() {
ActivityManager manager = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
for (RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)){
if("com.example.MyNeatoIntentService".equals(service.service.getClassName())) {
return true;
}
}
return false;
}
@pixbit
pixbit / index.html
Created July 27, 2012 00:58
Windows 8 Loading Animation
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Windows 8 Loading Animation &middot; CodePen</title>
<!--
Copyright (c) 2012 Jan Rubio, http://codepen.io/janrubio
Permission is hereby granted, free of charge, to any person obtaining
@atenni
atenni / README.md
Last active June 17, 2024 02:30
How to permalink to a gist's raw file

Problem: When linking to the raw version of a gist, the link changes with each revision.

Solution:

To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/

To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]

@willurd
willurd / web-servers.md
Last active June 13, 2024 14:37
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@clowwindy
clowwindy / ssl.md
Last active May 11, 2024 03:22
为什么不应该用 SSL 翻墙

SSL 设计目标:

  1. 防内容篡改
  2. 防冒充服务器身份
  3. 加密通信内容

而翻墙的目标:

  1. 不被检测出客户端在访问什么网站
  2. 不被检测出服务器在提供翻墙服务
@lecho
lecho / shadow.xml
Created September 7, 2013 07:01
Android shadow drawable xml.
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- Drop Shadow Stack -->
<item>
<shape>
<padding
android:bottom="1dp"
android:left="1dp"
android:right="1dp"
@Geal
Geal / client.rs
Last active March 7, 2022 21:54
Rust and Unix domain sockets usage example * stream sockets (client.rs and server.rs) * datagram sockets (datagram_client.rs and datagram_server.rs) * example of writing to syslog (incomplete for now)
extern mod native;
use std::io::net::unix::UnixStream;
use std::path::posix::Path;
use std::str;
use std::rt::rtio::IoFactory;
use native::io;
fn main() {