Skip to content

Instantly share code, notes, and snippets.

@SmMichael418
SmMichael418 / gist:7b941bd822dfd8308a8e06795f8f20ee
Created April 23, 2017 10:34
Encryption unicode string in PHP (RU)
<?php
function escape_win ($path){
$path = strtoupper ($path);
return strtr($path, array("\U0430"=>"а", "\U0431"=>"б", "\U0432"=>"в",
"\U0433"=>"г", "\U0434"=>"д", "\U0435"=>"е", "\U0451"=>"ё", "\U0436"=>"ж", "\U0437"=>"з", "\U0438"=>"и",
"\U0439"=>"й", "\U043A"=>"к", "\U043B"=>"л", "\U043C"=>"м", "\U043D"=>"н", "\U043E"=>"о", "\U043F"=>"п",
"\U0440"=>"р", "\U0441"=>"с", "\U0442"=>"т", "\U0443"=>"у", "\U0444"=>"ф", "\U0445"=>"х", "\U0446"=>"ц",
"\U0447"=>"ч", "\U0448"=>"ш", "\U0449"=>"щ", "\U044A"=>"ъ", "\U044B"=>"ы", "\U044C"=>"ь", "\U044D"=>"э",
"\U044E"=>"ю", "\U044F"=>"я", "\U0410"=>"А", "\U0411"=>"Б", "\U0412"=>"В", "\U0413"=>"Г", "\U0414"=>"Д",
"\U0415"=>"Е", "\U0401"=>"Ё", "\U0416"=>"Ж", "\U0417"=>"З", "\U0418"=>"И", "\U0419"=>"Й", "\U041A"=>"К",
@akhy
akhy / disable_nsurlsessionid.sh
Last active May 20, 2018 21:39
Disable NSURLSessionId
launchctl unload /System/Library/LaunchDaemons/com.apple.nsurlstoraged.plist
launchctl unload /System/Library/LaunchAgents/com.apple.nsurlsessiond.plist
sudo launchctl unload /System/Library/LaunchDaemons/com.apple.nsurlsessiond.plist
sudo launchctl unload /System/Library/LaunchDaemons/com.apple.nsurlstoraged.plist
@jodyheavener
jodyheavener / Instructions.md
Created August 18, 2015 04:55
Use Babel (ES6) with Sails JS

Inspired by this issue, with these instructions you should be able to get Babel transpiling your JS in Sails JS for the client side.

  1. Install Grunt Babel npm install --save grunt-babel
  2. Create a babel.js file under tasks/config and add something like the following:
module.exports = function(grunt) {

    grunt.config.set('babel', {
dev: {
@leoasis
leoasis / marionette_rivets.js
Last active March 7, 2019 16:00
React vs Marionette + Rivets
var List = Backbone.Marionette.CollectionView.extend({
itemView: Item,
tagName: 'ul'
});
var Item = Backbone.Marionette.ItemView.extend({
tagName: 'li',
template: function(data) {
return '<span rv-text="model.name"></span><p rv-text="model.description"><p>';
},