Skip to content

Instantly share code, notes, and snippets.

View Justasic's full-sized avatar
🏍️
Making computers do things they don't want to

NightShadow Justasic

🏍️
Making computers do things they don't want to
View GitHub Profile
@Justasic
Justasic / growl-xcode.patch
Last active December 16, 2015 15:19
Fix Growl compile on XCode. Patch with the following command in the growl directory: patch -p1 < growl-xcode.patch
--- growl.new/Plugins/Actions/SMS/GrowlSMSDisplay.m 2013-04-24 12:50:06.000000000 -0700
+++ growl/Plugins/Actions/SMS/GrowlSMSDisplay.m 2013-04-24 12:38:47.000000000 -0700
@@ -138,7 +138,7 @@
CFDataRef postData = CFStringCreateExternalRepresentation(kCFAllocatorDefault, dataString, kCFStringEncodingUTF8, 0U);
CFURLRef clickatellURL = CFURLCreateWithString(kCFAllocatorDefault, CFSTR("https://api.clickatell.com/xml/xml"), NULL);
NSMutableURLRequest *post = [[NSMutableURLRequest alloc] initWithURL:(NSURL *)clickatellURL];
- CFStringRef contentLength = CFStringCreateWithFormat(kCFAllocatorDefault, NULL, CFSTR("%u"), CFDataGetLength(postData));
+ CFStringRef contentLength = CFStringCreateWithFormat(kCFAllocatorDefault, NULL, CFSTR("%lu"), CFDataGetLength(postData));
// NSLog(@"SMS display: Sending data: %@", postData);
exit # Dont run this as a script
# LLVM seems to work great on Musl, there only seems some build errors
# when trying to build the sanitizers. So sanitizers have been disabled.
# This is rougly based on this:
# https://wiki.musl-libc.org/building-llvm.html
# But updated for LLVM 8
# We are also focusing on making a GNU-less toolchain, as there is
# no libgcc and no libstdc++, instead we favor LLVM's own compiler-rt
@EmilHernvall
EmilHernvall / bigdecoder.py
Created May 3, 2011 18:54
Decoder for EA games .big-files
# bigdecoder.py, by aderyn@gmail.com, 2009-03-01
#
# decoder for .BIG-format files utilized by Red Alert 3 and C&C: Zero Hours
# among others. .big is a trivial archival format. quite frankly, this is
# probably the simplest compound file format imaginable.
#
# this script is written for microsoft windows. it can probably be easily
# adapted for other platforms, but i haven't tried.
#
# file structure:
@ictlyh
ictlyh / libpq-epoll.cpp
Created December 30, 2016 01:56
postgresql epoll demo
/*
* Demo of libpq epoll.
* Build: g++ libpq-epoll.cpp -o libpq-epoll -lpq
* Run: ./libpq-epoll
*/
#include <arpa/inet.h>
#include <cstdlib>
#include <cstring>
#include <errno.h>
@scivision
scivision / cpack.cmake
Last active November 16, 2022 15:28
CPack template
# do this after all install(...) commands so that all targets are finalized.
# Essentially, the last thing included at the end of the top-level CMakeLists.txt
set(CPACK_GENERATOR "TBZ2")
set(CPACK_SOURCE_GENERATOR "TBZ2")
set(CPACK_PACKAGE_DIRECTORY ${PROJECT_BINARY_DIR}/package)
set(CPACK_SOURCE_IGNORE_FILES .git/ .github/ .vscode/ .mypy_cache/ _CPack_Packages/
${CMAKE_BINARY_DIR}/ ${PROJECT_BINARY_DIR}/
)
@Yoplitein
Yoplitein / gist:f4b671a2ec70c9e743fa
Created August 25, 2014 15:00
Dark theme for cgit
body {
background-color: #272822;
}
div#cgit {
padding: 0em;
margin: 0em;
font-family: sans-serif;
font-size: 10pt;
color: white;
@zhangsen
zhangsen / relative_time.py
Created September 7, 2011 07:22
python-relative-time
#
# This piece of code is in the public domain.
# <zh.jesse@gmail.com>
#
from datetime import datetime
def get_age(date):
'''Take a datetime and return its "age" as a string.
The age can be in second, minute, hour, day, month or year. Only the
@ilyakurdyukov
ilyakurdyukov / faster_lzma_decoder_x86.patch
Last active June 18, 2023 17:04
Faster LZMA decoder for x86 CPUs (patch for XZ Utils).
From 387fd25f57f41009fc317f7922e957de9f370ff2 Mon Sep 17 00:00:00 2001
From: Ilya Kurdyukov <jpegqs@gmail.com>
Date: Tue, 14 Dec 2021 21:54:32 +0700
Subject: [PATCH] faster lzma_decoder for x86
Notice: Uses inline assembly with CMOV instruction.
Another change that removes the comparison with in_size can give a few
percent speedup for architectures with a small number of registers.
---
@evildmp
evildmp / gist:3094281
Last active June 30, 2023 10:55
Set up Django, nginx and uwsgi

This document has now been incorporated into the uWSGI documentation:

http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html

Set up Django, nginx and uwsgi

Steps with explanations to set up a server using:

@alexxxdev
alexxxdev / gist:1dd024cadea091ca64154f9616d5739a
Created August 16, 2018 15:08
remote: fatal: pack exceeds maximum allowed size
# Adjust the following variables as necessary
REMOTE=origin
BRANCH=$(git rev-parse --abbrev-ref HEAD)
BATCH_SIZE=500
# check if the branch exists on the remote
if git show-ref --quiet --verify refs/remotes/$REMOTE/$BRANCH; then
# if so, only push the commits that are not on the remote already
range=$REMOTE/$BRANCH..HEAD
else