Skip to content

Instantly share code, notes, and snippets.

View smeevil's full-sized avatar
🥰
Hugs for all!

Gerard de Brieder smeevil

🥰
Hugs for all!
  • Govannon
  • Netherlands
View GitHub Profile

Keybase proof

I hereby claim:

  • I am smeevil on github.
  • I am smeevil (https://keybase.io/smeevil) on keybase.
  • I have a public key ASBOjzbEMuSL7Dm11vlW5GwW6-DgFhuclmXHjCU7X3gc-Qo

To claim this, I am signing this object:

1. In Library/LaunchDaemons create a file named limit.maxfiles.plist and paste the following in (feel free to change the two numbers (which are the soft and hard limits, respectively):
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>limit.maxfiles</string>
<key>ProgramArguments</key>
@smeevil
smeevil / IntelliJ_IDEA__Perf_Tuning.txt
Created April 4, 2017 19:19 — forked from P7h/IntelliJ_IDEA__Perf_Tuning.txt
Performance tuning parameters for IntelliJ IDEA. Add these params in idea64.exe.vmoptions or idea.exe.vmoptions file in IntelliJ IDEA. If you are using JDK 8.x, please knock off PermSize and MaxPermSize parameters from the tuning configuration.
-server
-Xms2048m
-Xmx2048m
-XX:NewSize=512m
-XX:MaxNewSize=512m
-XX:PermSize=512m
-XX:MaxPermSize=512m
-XX:+UseParNewGC
-XX:ParallelGCThreads=4
-XX:MaxTenuringThreshold=1
@smeevil
smeevil / gist:7649b617f2bc8ee03f8a
Created September 16, 2015 11:51
Phoenix hidden field with boolean value
In phoenix when using a hidden field that should contain the value of a boolean with "<%= hidden_input f, :anonymous %>" it renders the following :
When true :
<input id="investment_anonymous" name="investment[anonymous]" type="hidden" value="value">
When false :
<input id="investment_anonymous" name="investment[anonymous]" type="hidden">
I would expect it to render the following :
@smeevil
smeevil / price_formatter.ex
Created August 25, 2015 09:07
price formatter
defmodule Sheep.PriceFormatter do
def format(number) when is_integer(number) do
"€ " <> (number |> set_decimal |> Float.to_string(decimals: 2) |> set_separators)
end
def format(not_a_number) do
string_number = not_a_number |> to_string |> String.replace(~r/\D/, "")
{number, _} = Integer.parse(string_number)
number |> format
end
@smeevil
smeevil / gist:b235969299cac4d2eb56
Last active August 29, 2015 14:23
Unity Get Angle of Transform to Self
public static float GetAngleOfTransformToSelf(Transform other, Transform origin, bool debug) {
var angle = (Math.Atan2(other.position.z - origin.position.z, other.position.x - origin.position.x)*Mathf.Rad2Deg);
angle += origin.rotation.eulerAngles.y;
angle -= 90;
while (angle > 180) angle -= 360;
if (!debug) return (float) angle;
Debug.Log(string.Format("angle orgin {0} to {1} : {2}", origin, other, angle), origin);
Debug.DrawLine(origin.position, other.position, Color.white, 1.0f);
return (float)angle;
str="You shall not not pass"
if str == "Somehow it does" || "But why is that?"
console.log "I passed with no problems ??"
str="You shall not not pass"
if str == ("I cannot pass anymore" || "Me either")
console.log "This indeed never happens"
@smeevil
smeevil / irccloud-toggle
Last active August 29, 2015 14:15
Toggle irccloud cruft
// ==UserScript==
// @name Minimal Irc Cloud
// @namespace http://govannon.nl/
// @version 0.1
// @description Add a button to toggle minimal mode for irc cloud
// @author Smeevil
// @match https://www.irccloud.com
// @grant none
// ==/UserScript==
setTimeout(function() {
@smeevil
smeevil / gist:4f9be1d21003fdb5c464
Last active August 29, 2015 14:15
shared function
Template.foo.rendered = ->
@_mySharedFunction = ->
console.log "yeah baby"
Template.foo.events
'click .something': (e, template)->
template._mySharedFunction()
Template.foo.helpers
myHelper: ->
Template.chatLine.helpers
username: ->
username = userIdsToUserNames[@userId]
return username if username
console.log "searching for id #{@userId}"
user = Meteor.users.findOne(_id: @userId)
if user?
userIdsToUserNames[@userId] = user.username
return user.username
else