Skip to content

Instantly share code, notes, and snippets.

Avatar
👻
Hunting bugs like Ghost Buster !

Moki Ding m0k1

👻
Hunting bugs like Ghost Buster !
View GitHub Profile
@m0k1
m0k1 / mojave.xml
Created Jul 1, 2018 — forked from trongthanh/mojave.xml
macOS Mojave dynamic background re-implement as GTK+ background slideshow. Background images are changed to reflect the time of the day.
View mojave.xml
<!-- Intruction:
- Download and unzip Mojave dynamic background here: https://files.rb.gd/mojave_dynamic.zip
- Fix the path to the background images
- Use gnome-tweaks tool to select this XML as wallpaper
-->
<background>
<starttime>
<year>2014</year>
<month>01</month>
<day>11</day>
@m0k1
m0k1 / gource.sh
Last active Mar 4, 2018 — forked from cgoldberg/gource.sh
Generate a MP4 Video for your Git project commits using Gource!
View gource.sh
# install bzr and gource
# get a branch of Mir's trunk code
# create gource video
$ sudo apt-get install bzr gource
$ bzr branch lp:mir
$ cd mir
$ gource \
-s .06 \
@m0k1
m0k1 / web-service-soap-client-server-php.md
Created Feb 22, 2018 — forked from umidjons/web-service-soap-client-server-php.md
Simple Web service - SOAP Server/Client in PHP
View web-service-soap-client-server-php.md

Simple Web service - SOAP Server/Client in PHP

Implementation of the SOAP server - server.php:

<?php
// turn off WSDL caching
ini_set("soap.wsdl_cache_enabled","0");

// model, which uses in web service functions as parameter
@m0k1
m0k1 / web-service-soap-client-server-php.md
Created Feb 22, 2018 — forked from umidjons/web-service-soap-client-server-php.md
Simple Web service - SOAP Server/Client in PHP
View web-service-soap-client-server-php.md

Simple Web service - SOAP Server/Client in PHP

Implementation of the SOAP server - server.php:

<?php
// turn off WSDL caching
ini_set("soap.wsdl_cache_enabled","0");

// model, which uses in web service functions as parameter
@m0k1
m0k1 / raspberry_pi_optimization.md
Last active Feb 16, 2018 — forked from cybear/raspberry_pi_optimization.md
I read up a little on performance optimization for the Raspberry Pi, and gathered the links before they disappear from my short term memory.
View raspberry_pi_optimization.md

Raspberry Pi general optimization

  • Use a class 10 SD card for best speed. The USB bus can't come much higher than 30MB/s so you don't have to buy any extremely fast ones though. Not all cards are compatible, check the compatibility list: http://elinux.org/RPi_SD_cards
  • Use the HardFloat version of Raspbian instead of the SoftFloat. HF has much faster floating point operations - however SF is required for running Java. So it's either Java or performance, like normal.
  • The official Raspbian image gives low network speeds: http://elinux.org/RPi_Performance#NIC
  • A graphics driver by Simon / teh_orph is using hardware acceleration for some instructions: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=63&t=28294 installation instructions: http://elinux.org/RPi_Xorg_rpi_Driver
  • The firmware can be upgraded which gives, among other things, better GPU performance.
@m0k1
m0k1 / gist:d20d544bf38abe12fdc5b57c9d87acae
Created Aug 1, 2017 — forked from marty-wang/gist:5a71e9d0a6a2c6d6263c
Compile and deploy React Native Android app of Release version to device.
View gist:d20d544bf38abe12fdc5b57c9d87acae
Disclaimer: The instructions are the collective efforts from a few places online.
Nothing here is my original. But I want to put them together in one place to save people from spending the same time as I did.
First off, bundle.
==================
1. cd to the project directory
2. Start the react-native packager if not started
3. Download the bundle to the asset folder:
curl "http://localhost:8081/index.android.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"
View ubuntu-php-development-environment.md

#Introduction If you're a php developer on ubuntu, there comes the time where you have to install/reinstall your system. I did it already a few times and i decided to write down the steps for a typical web developer stack with php. This is for a developer machine and not for a live environment!

I hope it helps you too!

fyi @mheiniger and me started with an installer here: https://github.com/mheiniger/webdev-setup

View Vehicle Mapper
#include <a_samp>
#include <streamer>
#include <zcmd>
#include <sscanf2>
#include <foreach>
// EDIT THESE DEFINES TO WHATEVER SUITS YOU
#define USE_SYNC true // respawns the vehicle after you hit the cancel/finish button so it syncs with the world, disable this if you're mapping on a hill and the vehicle accidentally drives down the hill.
#define MAX_VEHICLES_PER_PLAYER (50) // maximum amount of vehicles 1 player can spawn
#define LABEL_COLOR 0xFFFFFFFF // Vehicle's label color
View gist:ff0679a857ef49d357bf
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key